<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://www.extremecomponents.org" prefix="ec"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="includeCSSjs.jsp" />
	
	<script type="text/javascript">
	
	$(document).ready(function() {
		$("#colegio").validate();
	});
	
	function onTableClick(	idGrado,
							grado	) {
		
		$("#idColegio").val(idGrado);
		$("#nombreColegio").val(grado);
		showEdit();
	}
	
	function showEdit() {
				$(".editbutton_div").hide("fast");
				$(".button_div").hide("slow");
				$(".editbutton_div").show("slow");

			}

			function hiddenEdit() {
				$(".editbutton_div").hide("fast");
				$(".button_div").show("slow");
			}
			
	</script>
	
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Fotos</title>
</head>
<body>

<div id="container">

<!-- Aqui va el menu -->
<jsp:include page="menu.jsp" />
<div id="content">

<div id="top">
		<h2 class="divTextoEncabezado">Fotos de Aventura </h2>
  </div>
<div id="leftSide">
  
  <table border=1>
  <tr>
  <th>Titulo</th><th>Imagen</th><th>Propietario</th><th>Descripci&oacute;n</th><th>Comentarios</th><th>Comentar</th>
  </tr>
  <c:forEach var="photo" items="${photoList}">
  	<tr>
  	<td><c:out value="${photo.title}"/></td>
  	<td><img src="data:image/jpg;base64,<c:out value='${photo.photoFile}'/>" /></td>
  	<td><c:out value="${photo.owner}"/></td>
  	<td><c:out value="${photo.description}"/></td>
  	<td>
  	<c:forEach var="comment" items="${photo.tblComments}">
  	<c:out value="${comment.subject}"/>:<c:out value="${comment.body}"/><br />
  	<b><c:out value="${comment.tblUser.username}"/></b><br />
  	<hr />
  	</c:forEach>	
  </td>
  	<td><a href="addComment?photoId=${photo.photoId}">Agregar comentario</a></td>
    </tr> 
</c:forEach>
		</table>
		
</div>
  <div class="clear"></div>
		
		

		

				

	

	
	</div>



</div>
	
</body>
</html>